import CryptoJS from 'crypto-js'


const iv = CryptoJS.enc.Utf8.parse('8C25Ea35FC4E3BFc');   //十六位十六进制数作为密钥偏移量


//** 加密 **
export function aesEncrypt(word,key){
key = CryptoJS.enc.Utf8.parse(key);  //十六位十六进制数作为密钥
let srcs = CryptoJS.enc.Utf8.parse(word);
let encrypted = CryptoJS.AES.encrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
return encrypted.toString();
e
}

// 解密
export function aesDecrypt(word,key){
  key = CryptoJS.enc.Utf8.parse(key);
  let value = CryptoJS.AES.decrypt(word, key, { iv: iv, mode: CryptoJS.mode.CBC })
  let result = CryptoJS.enc.Utf8.stringify(value).toString()
  return result
}

export const kk='uBdUx82vPHkDKb284d7NkjFoNcKWBuka'
